package my.learnDB.mybatisPlus.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class User implements Serializable {
    private Integer id;

    @TableField(value = "username")
    private String name;  // 数据库 username

    @TableField(value = "sex")
    private String gender;  // 数据库 sex

    @TableField(value = "password")
    private String pwd;  // 数据库 password


    public User(String name, String gender, String password) {
        this.name = name;
        this.gender = gender;
        this.pwd = password;
    }

    @Override
    public String toString() {
        return "my.learnDB.jpa.domain.User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
